#!/bin/bash
log_file='tunel.log'
log_file_error='tunel.error.log'
from_to_host_port="\
        -R localhost:2022:localhost:22\
        -R localhost:2023:localserver:1022\
        -R localhost:2389:localhost:3389\
        -R localhost:2081:localserver:8080\
        -R localhost:2080:tci_svn:80\
        -R localhost:2043:tci_svn:443\
"
tunel_hosts="admin@marcinlula.webhop.net admin@marcinlula.webhop.org"
ssh_command="'while true; do echo $$; sleep 15; done;'"

echo "" > $log_file
echo "" > $log_file_error
for tunel_host in $tunel_hosts; do
	nohup bash -c "while true; do ssh $from_to_host_port $tunel_host $ssh_command; sleep 5; done;" 1>>$log_file 2>>$log_file_error &
done;
